package cn.edu.nwsuaf.examcenter.pojo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ExerciceExamId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ExerciceExamId implements java.io.Serializable {

	// Fields

	private String examNo;
	private String itemNo;

	// Constructors

	/** default constructor */
	public ExerciceExamId() {
	}

	/** full constructor */
	public ExerciceExamId(String examNo, String itemNo) {
		this.examNo = examNo;
		this.itemNo = itemNo;
	}

	// Property accessors

	@Column(name = "exam_no", nullable = false, length = 50)
	public String getExamNo() {
		return this.examNo;
	}

	public void setExamNo(String examNo) {
		this.examNo = examNo;
	}

	@Column(name = "item_no", nullable = false, length = 50)
	public String getItemNo() {
		return this.itemNo;
	}

	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ExerciceExamId))
			return false;
		ExerciceExamId castOther = (ExerciceExamId) other;

		return ((this.getExamNo() == castOther.getExamNo()) || (this
				.getExamNo() != null && castOther.getExamNo() != null && this
				.getExamNo().equals(castOther.getExamNo())))
				&& ((this.getItemNo() == castOther.getItemNo()) || (this
						.getItemNo() != null && castOther.getItemNo() != null && this
						.getItemNo().equals(castOther.getItemNo())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getExamNo() == null ? 0 : this.getExamNo().hashCode());
		result = 37 * result
				+ (getItemNo() == null ? 0 : this.getItemNo().hashCode());
		return result;
	}

}